package com.lanting.meetingserver.util;

public class ConvertEnum2Str {

	
	/**
	 * 将服务器类型值转换成描述
	 * */
	public static String getServerType(int value){
		switch (value) {
		case 0:
			//return "内部";
			return "LOCAL";
		case 1:
			//return "公共";
			return "WIDE";
		case 2:
			//return "临时";
			return "TEMP";
		default:
			return "";
		}
	}
	
	/**
	 * 将错误级别值转换成描述
	 * */
	public static String getErrorLevel(int value){
		switch (value) {
		case 0:
			return "error";
		case 1:
			return "fatal";
		default:
			return "";
		}
	}
	
	/**
	 * 将错误代码转换成描述
	 * */
	public static String getErrorMsgByErrorCode(int code){
		switch (code) {
		case CommonEnum.ERROR_CODE_NOUSER:
			return "用户名或密码错误！";
		case CommonEnum.ERROR_CODE_ANALYSISPARAM_FAILED:
			return "解析参数失败！";
		case CommonEnum.ERROR_CODE_NODATA:
			return "没有数据！";
			//return "Analysis param failed!";
		case CommonEnum.ERROR_CODE_NOBAKFILE:
			return "没有备份ppt文件！";
		case CommonEnum.ERROR_CODE_NOFILE:
			return "没有提供ppt原始zip包文件！";
		default:
			return "";
		}
	}
	
	/**
	 * 将会议信息状态值转换成描述
	 * */
	public static String getMeetingInfoStatus(int code){
		//会议状态包括：new,running,end,expired 分别表示未召开，召开中，已结束，已过期；其中expired清示会议还没有
		switch (code) {
		case 0:
			return "new";
		case 1:
			return "running";
		case 2:
			return "end";
		case 3:
			return "expired";
		default:
			return "";
		}
	}
	
	/**
	 * 将角色值转换成描述
	 * */
	public static String getRole(int code){
		switch (code) {
		case 0:
			return "speaker";
		case 1:
			return "listener";
		default:
			return "";
		}
	}
	
	/**
	 * 将投票选择方式值转换成描述
	 * */
	public static String getVoteSelectWay(int code){
		switch (code) {
		case 0:
			return "单选";
		case 1:
			return "多选";
		default:
			return "";
		}
	}
	
	/**
	 * 将投票状态值转换成描述
	 * */
	public static String getVoteStatus(int code){
		switch (code) {
		case 1:
			return "未发起";
		case 2:
			return "投票中";
		case 3:
			return "投票结束";
		default:
			return "";
		}
	}
}
